package com.sondon.mayi.util;

import android.widget.EditText;
import android.widget.Spinner;
import android.widget.TextView;

/**
 * @author mayi
 *	获取控件的getString()内容
 */
public class GetStrUtil {
	
	
	public static String getViewStr(EditText et){
		if(et==null){
			return "";
		}
		return et.getText().toString().trim();
	}
	
	
	public static String getViewStr(Spinner sp){
		if(sp ==null | sp.getSelectedItem() ==null){
			return "";
		}
		return sp.getSelectedItem().toString().trim();
	}
	
	public static String getViewStr(TextView tv){
		if(tv==null){
			return "";
		}
		return tv.getText().toString().trim();
	}
	
}
